/* void absAlt_Click1(GOption opt_selected, GOption opt_deselected) { //_CODE_:System2:804009:
  altSelect = 0;
}

void pAGL_Click1(GOption opt_selected, GOption opt_deselected) { //_CODE_:System2:804009:
  altSelect = 1;
}

void sAGL_Click1(GOption opt_selected, GOption opt_deselected) { //_CODE_:System2:804009:
  altSelect = 2;
}

void iAGL_Click1(GOption opt_selected, GOption opt_deselected) { //_CODE_:System2:804009:
  altSelect = 3;
}

void magnetic_Click1(GOption opt_selected, GOption opt_deselected) { //_CODE_:System2:804009:
  useMagCompass = true;
}

void gyro_Click1(GOption opt_selected, GOption opt_deselected) { //_CODE_:System2:804009:
  useMagCompass = false;
}

void motorTest_button(GButton button) {
  sendTest();
}

void resetStab_button(GButton button) {
  sendResetStab();
}

void keyPressed() {
  switch (key) {
    case 'c': {
      touchControl = true;
      break;
    }
    case ' ': {
      touchControl = false;
      break;
    }
    case 's': {
      OscMessage myMessage = new OscMessage("/s");
      osc.send(myMessage, quadAddr);
      println("Sending /s");
      break;
    }
  }
}


void doTouch() {
  int n_touch = touchpad.getTouch();
  
  switch (n_touch) {
    case 0: {
      touchState = 0;
      break;
    }
    case 1: {
      
      switch (touchState) {
        case 0: {
          x0 = touchpad.xPosition;
          y0 = touchpad.yPosition;
          touchState = 1;
          break;
        }
        case 1: {
          stickP = y0 - touchpad.yPosition;
          stickR = touchpad.xPosition - x0;
          break;
        }
      }
      
      break;
    }
    case 2: {
      
      switch (touchState) {
        case 0: {
          x0 = touchpad.xPosition;
          y0 = touchpad.yPosition;
          touchState = 2;
          break;
        }
        case 2: {
          float dy = touchpad.yPosition - y0;
          float dx = touchpad.xPosition - x0;
          if ((abs(dy) > abs(dx)) && abs(dy) > 0.05) {
            touchState = 3;
            y0 += dy;
          } else if ((abs(dx) > abs(dy)) && abs(dx) > 0.05) {
            touchState = 4;
            x0 += dx;
          }
          break;
        }
        case 3: {
          throttle = touchpad.yPosition - y0;
          break;
        }
        case 4: {
          rudder = touchpad.xPosition - x0;
          break;
        }
      }
      
      break;
    }
  }
}
*/
